package com.cneport.das.client.conf;

import com.cneport.das.common.validate.FieldCheck;
import com.cneport.das.common.validate.FvEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @Desc 文件交互的配置
 * @Ver 1.0
 * @Author GavinZhang
 * @Company 东方物通科技有限（北京）公司
 * @Date 2022-01-07 14:09:57
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "config")
public class FileConf {

    @XmlElement(name = "fileUp")
    private FileConf.FileUp fileUp;

    @XmlElement(name = "fileDown")
    private FileConf.FileDown fileDown;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class FileUp {
        @FieldCheck(name = "DAS client 读取目录", type = FvEnum.STRING, isNullable = false)
        @XmlElement(name = "dest")
        private String dest;
        @XmlElement(name = "format")
        private String format;
        @XmlElement(name = "freq")
        private Long freq;

    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class FileDown {
        @FieldCheck(name = "DAS client 写入目录", type = FvEnum.STRING, isNullable = false)
        @XmlElement(name = "out")
        private String out;
        @XmlElement(name = "maxCnt")
        private Integer maxCnt;
        @XmlElement(name = "freq")
        private Long freq;
        @XmlElement(name = "liveDays")
        private Integer liveDays;
        @XmlElement(name = "archDays")
        private Integer archDays;

    }
}
